import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int n = 0;
        int guess = 0;
        Random random = new Random();
        n = random.nextInt(100)+1;//[1,101)
        Scanner scanner = new Scanner(System.in);
        while(true){
            System.out.println("请输入你猜的数字：");
            guess = scanner.nextInt();
            if(guess == n){
                System.out.println("恭喜你答对啦");
                break;
            }else if(guess > n){
                System.out.println("你猜的数字大了：");
            }else{
                System.out.println("你猜的数字小了");
            }
        }

    }
    public static void main1(String[] args) {
//        for (int i = 0; i <= 100; i++) {
//            if(i%3 == 0&&i%5==0){
//                System.out.println(i);
//            }
//        }
//        Scanner scanner  = new Scanner(System.in);
//        System.out.println("请输入你的年龄：");
//        int i = scanner.nextInt();
//        System.out.println("年龄"+i);
          Scanner scanner  = new Scanner(System.in);
          while(scanner.hasNext()){//ctrl d 结束循环（idea）
              int i = scanner.nextInt();
              System.out.println(i);
          }
    }
}
